import Vue from 'vue';
import VueRouter from 'vue-router';
import Layout from '@/layout'

Vue.use(VueRouter);

const routers = [
  {
    path: '/',
    redirect: '/dashboard',
  },
  {
    path: '/login',
    component: (resolve) => require(['@/views/login'], resolve),
  },
  {
    path: '',
    component: Layout,
    children: [
      {
        path: '/profile',
        component: (resolve) => require(['@/views/system/profile'], resolve)
      }
    ]
  },
];

export default new VueRouter({
  mode: 'hash',
  scrollBehavior: () => ({ y: 0 }),
  routes: routers,
});
